#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

class Solution {
public:
    int StrToInt(string str)
    {
        if (str.size() == 0) return 0;
        int flag = 0;
        int res = 0;
        if (str[0] == '-')
        {
            flag = -1;
            str.erase(0, 1);
        }
        else if (str[0] == '+')
        {
            flag = 1;
            str.erase(0, 1);
        }

        //reverse(str.begin(), str.end());
        for (int i=0;i<str.size();i++)
        {
            if (isalpha(str[i])) return 0;
        }
        res = stoi(str);
        

        return res;
    }
};

int main()
{
    Solution S;
    string s="-a23456789";
    cout << S.StrToInt(s) << endl;
    return 0;
}

create table stu(
    schid int(16) primary key,
    name varchar(32) not null,
    score int,
    );
create table score(
    schid int(16),
    classid int(8) not null,
   
    foreign key(schid) references stu(schid)
);